<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			window.onload = function() {
				var colors = ["red", "blue", "green"];
				var colorMeans = ["热情", "冷静", "生机"];
				var ul = document.createElement("ul");
				for (var k in colors) {// 遍历的是数组的下标
					console.log(k);
					var li = document.createElement("li");
					li.setAttribute("mean", colorMeans[k]);
					var txt = document.createTextNode(colorMeans[k]);
					// 添加子节点
					li.appendChild(txt);
					ul.appendChild(li);
				}
				document.body.appendChild(ul);
			}
			
		</script>
	</head>
	<body>
		
	</body>
</html>
